package genericclassdemo;

public class Base<T> {
    private T obj;

    public Base() {
    }

    public Base(T obj) {
        this.obj = obj;
    }

    public T getObj() {
        return obj;
    }

    public void setObj(T obj) {
        this.obj = obj;
    }

    public void print() {
        System.out.println("obj type is: " + obj.getClass().getName()+",value is:"+obj);
    }

    public <T> void print(T[] arr) {
        for(T obj: arr){
            System.out.println(obj);
        }
    }

    public static void main(String[] args) {

    }
}
